#ifndef CLIENTWINDOW_H
#define CLIENTWINDOW_H

#include <QtGui/QMainWindow>
#include "clientconnection.h"
#include "connectionplayer.h"

namespace Ui {
    class ClientWindow;
}

class ClientWindow : public QMainWindow {
    Q_OBJECT
public:
    ClientWindow(QWidget *parent = 0);
    ~ClientWindow();
    ClientConnection *getClient()
    {
        return client;
    }

protected:
    void changeEvent(QEvent *e);
private:
    ClientConnection *client;
    Ui::ClientWindow *m_ui;
    void connectedControlsState();
    void disconnectedControlsState();
private slots:
    void on_btnConnect_clicked();
    void onConnectionStateChanged(QAbstractSocket::SocketState state);
signals:
    void connectionStateChanged(QAbstractSocket::SocketState state);
    void newPlayerConnected(ConnectionPlayer*);
};

#endif // CLIENTWINDOW_H
